//
//  GRStoreModel.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/8/29.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRStoreDetailModel.h"
#import "GRDiscountGoodModel.h"
#import "GRStoreCommentModel.h"
#import "GRNewsModel.h"
@implementation GRStoreDetailModel
- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic{
    NSArray *discoutArr = dic[@"discountList"];
    if (Array(discoutArr)) {
        NSMutableArray *disCountListArr = [NSMutableArray array];
        for (NSDictionary *discountDic in discoutArr) {
            GRDiscountGoodModel *model = [GRDiscountGoodModel yy_modelWithDictionary:discountDic];
            [disCountListArr addObject:model];
        }
        self.discountList = disCountListArr;
    }
    NSArray * commentArr = dic[@"commentList"];
    if (Array(commentArr)) {
        NSMutableArray * commentListArr = [NSMutableArray array];
        for (NSDictionary * commentDic in commentArr) {
            GRStoreCommentModel * commentModel = [GRStoreCommentModel yy_modelWithDictionary:commentDic];
            [commentListArr addObject:commentModel];
        }
        self.commentList = commentListArr;
    }
    NSArray *newsList = dic[@"newsList"];
    if (Array(newsList)) {
        NSMutableArray * newsListArr = [NSMutableArray array];
        for (NSDictionary * newsDic in newsList) {
            GRNewsModel * newsModel = [GRNewsModel yy_modelWithDictionary:newsDic];
            [newsListArr addObject:newsModel];
        }
        self.newsList = newsListArr;
    }
    
    return YES;
}

// 如果实现了该方法，则处理过程中会忽略该列表内的所有属性
+ (NSArray *)modelPropertyBlacklist {
    return @[
             @"commentList",
             @"discountList",
             @"newsList"
             ];
}


@end
